using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Jizsoft.JFrame.Identity.WebApp
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            //routes.IgnoreRoute("{resource}.ashx/{*pathInfo}");
            routes.IgnoreRoute("{resource}.sso/{*pathInfo}");
            //routes.MapRoute("openid", "openid1/{id}", new { controller = "OpenId", action = "Ask", id = UrlParameter.Optional });


            routes.MapRoute(
                "User identities",
                "user/{id}/{action}",
                new { controller = "User", action = "Identity", id = string.Empty, anon = false });
            routes.MapRoute(
                "PPID identifiers",
                "anon",
                new { controller = "User", action = "Identity", id = string.Empty, anon = true });

            routes.MapRoute(
                name: "Default", // Route name
                url: "{controller}/{action}/{id}", // URL with parameters
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            ); 
            //routes.MapRoute(
            //     name: "OpenId", // Route name
            //     url: "openid/{action}/{account}", // URL with parameters
            //     defaults: new { controller = "OpenId", action = "Ask", account = UrlParameter.Optional } // Parameter defaults
            // );
            
        }
    }
}